import org.junit.Test;
import redis.clients.jedis.Jedis;

public class HowConnection {

    @Test
    public void connectRedis() {
        final String HOST = "localhost";
        final Integer PORT = 6380;
        Jedis jedis = new Jedis(HOST, PORT);
        System.out.println(jedis);


        String key = "hello";
        String value = "redis";

        String set = jedis.set(key, value);
        System.out.println(set);
        set = jedis.get(key);
        System.out.println(set);

        jedis.close();
    }
}
